using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

//@author A0090998H
namespace EZXPNS
{
    static class IncomeCategory
    {
        private static List<string> _incomeItems;

        //Constructor
        static IncomeCategory()
        {
            _incomeItems = new List<string>();
        }
        
        //Property for _incomeItems
        public static List<string> IncomeItems
        {
            get { return _incomeItems; }
            set { _incomeItems = value; }
        }

        //Write working memory data to data storage-IncomeCategory.txt file
        public static void UpdateCategory()
        {
            StreamWriter outputfile;
            outputfile = File.CreateText("../../IncomeCategory.txt");

            for (int i = 0; i < IncomeItems.Count; i++)
            {
                outputfile.WriteLine(IncomeItems[i]);
            }

            outputfile.Close();
        }
    }
}
